package com.xbongbong.saas.model;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.IModel;
import com.xbongbong.pro.businessdata.pojo.dto.FormatExplainDTO;
import com.xbongbong.pro.domain.entity.UpdateDataEntity;
import com.xbongbong.pro.formdata.pojo.dto.SaasAnalysisDataDTO;
import com.xbongbong.saas.domain.entity.OtherIncomeEntity;
import org.elasticsearch.action.support.WriteRequest;

import java.util.List;
import java.util.Map;


/**
 * @author bomfish
 */
public interface OtherIncomeModel extends IModel<OtherIncomeEntity> {
   @Override
   Integer insert(OtherIncomeEntity entity) throws XbbException;

   @Override
   List<OtherIncomeEntity> findEntitys(Map<String, Object> param);

   @Override
   Integer getEntitysCount(Map<String, Object> param);

   @Override
   Integer update(OtherIncomeEntity entity) throws XbbException;

   OtherIncomeEntity getByKey(Long key, String corpid);

   @Override
   List findEntitysWithoutSub(Map<String, Object> param);
   /**
    * 批量更新
    * @param updateList 供应商id列表
    * @param corpid 公司id
    * @return
    * @throws XbbException
    */
   Integer updateBatch(List<UpdateDataEntity> updateList, String corpid) throws XbbException;
   /**
    * 批量更新
    * @param updateList
    * @param corpid
    * @param refreshPolicy
    * @return
    */
   Integer updateBatch(List<UpdateDataEntity> updateList, String corpid, WriteRequest.RefreshPolicy refreshPolicy) throws XbbException;

   /**
    * 编辑时将获取数据格式化
    * @param saasAnalysisDataDTO
    * @param result
    * @throws XbbException
    * @author zcp
    * @since v1.0
    * @version v1.0
    */
   void formatData(SaasAnalysisDataDTO saasAnalysisDataDTO, JSONObject result) throws XbbException;

   /**
    * 编辑时格式化解释
    * @param formatExplainDTO
    * @throws XbbException
    * @author zcp
    * @since v1.0
    * @version v1.0
    */
   void formatUpdateExplain(FormatExplainDTO formatExplainDTO) throws XbbException;

    void deleteBatch(List<Long> ids, String corpid) throws XbbException;
}
